package io.fft.flight.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @Author: likailun
 * @Description: 支付方式
 * @Date: create in 2024/8/5 21:51
 */
@Getter
@AllArgsConstructor
public enum PayTypeEnum implements BaseEnum<String> {

    YPAY("YPAY", "胤钱宝支付"),
    ALIPAY("ALIPAY", "支付宝支付"),
    WECHAT_PAY("WECHATPAY", "微信支付");

    private final String code;
    private final String message;

    public static Optional<PayTypeEnum> getByCode(String code) {
        return Arrays.stream(PayTypeEnum.values()).filter(item -> item.getCode().equals(code)).findAny();
    }
}
